﻿using System;
using System.IO;
using System.Reflection;
using System.Xml;

namespace YArchitech.HVAC
{
	public class HelpSet
	{
		public static string hyGetPath()
		{
			string path = Assembly.GetExecutingAssembly().Location;
			path = Path.GetDirectoryName(path);
			return Path.GetDirectoryName(path);
		}

		public static string hyGetNewHelpChm()
		{
			return HelpSet.hyGetPath() + "\\Help\\盈建科机电设计（Revit）2015.chm";
		}

		public static string hyGetHelpChm()
		{
			return HelpSet.hyGetPath() + "\\Help\\HYRME.chm";
		}

		public static string hyGetHVACHelpChm()
		{
			return HelpSet.hyGetPath() + "\\Help\\HYBIMHVAC.chm";
		}

		public static string hyGetGPSHelpChm()
		{
			return HelpSet.hyGetPath() + "\\Help\\HYBIMGPS.chm";
		}

		public static string hyGetHelpSet()
		{
			return HelpSet.hyGetPath() + "\\Data\\HelpSet.xml";
		}

		public static string hyGetHelpIndex(string tabName)
		{
			XmlDocument xmlDocument = new XmlDocument();
			xmlDocument.Load(HelpSet.hyGetHelpSet());
			XmlNode xmlNode = xmlDocument.SelectSingleNode("Helps/Help[@TabName='" + tabName + "']");
			return xmlNode.Attributes["HelpIndex"].Value.ToString();
		}

		public static string hyGetElectricHelpChm()
		{
			return HelpSet.hyGetPath() + "\\Help\\HYBIMElectric.chm";
		}

		public static string hyGetArchHelpChm()
		{
			return HelpSet.hyGetPath() + "\\Help\\YJKArch.chm";
		}
	}
}
